setInterval("refreshTimer()", 1000);

function refreshTimer(){
	var timer = document.getElementById("timer");
	var expiration = timer.getAttribute("name");
	if(expiration>0){
		timer.setAttribute("name", expiration-1);
		timer.innerHTML = expiration-1;
	} else {
		var radio1, radio2;
		radio1 = document.getElementById("A");
		radio2 = document.getElementById("B");
		if(radio1.getAttribute("checked")==true || radio2.getAttribute("checked")==true){
			submitVote();
		} else {
			//hay que crear un round nuevo
			timer.setAttribute("name", timer.getAttribute("class"));
		}
	}
}

function submitVote(){
	document.forms["vote"].submit();
}